package com.llmcu.source.java8.java8inaction.chapter12;

import java.time.LocalDate;
import java.time.temporal.ChronoUnit;

/**
 * 陈述式方法创建一个新的修改版本
 *
 * @author liuling
 * @date 2024-12-18 15:25
 */
public class DeclarativeMannerDemo {
    public static void main(String[] args) {
        LocalDate localDate = LocalDate.of(2024, 2, 28);
        LocalDate aWeekLater = localDate.plusWeeks(1);
        LocalDate aWeekAgo = localDate.minus(1, ChronoUnit.WEEKS);
        System.out.println(localDate);
        System.out.println(aWeekLater);
        System.out.println(aWeekAgo);
    }
}
